#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.65])
AC_INIT([ssocks], [0.0.14], [h.caron@codsec.com])
AC_CONFIG_SRCDIR([src/auth-util.c])
AC_CONFIG_HEADERS([config.h])

# libtool
AC_PROG_LIBTOOL
AC_DISABLE_SHARED 
AC_ENABLE_STATIC
AC_SUBST(LIBTOOL_DEPS)

AM_CONDITIONAL(USE_STATIC, test $enable_static = yes)

# Checks for programs.
AC_PROG_CC

# I need it!
AM_INIT_AUTOMAKE
#([ssocks], [0.0.1])

# Checks for libraries.
#AC_CHECK_LIB(pthread, pthread_create)

# Check SSL
AC_ARG_WITH(ssl,
[  --with-ssl enable ssl
],
[   AC_MSG_RESULT(Enable SSL ...)
    AC_CHECK_LIB(ssl, SSL_library_init)
	AM_CONDITIONAL(WITH_SSL, /bin/true)
],
[
    AC_MSG_RESULT(No SSL ...)
    AM_CONDITIONAL(WITH_SSL, /bin/false)
])

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_TYPE_UINT16_T

# Checks for library functions.
AC_FUNC_FORK
AC_CHECK_FUNCS([atexit gethostbyname gettimeofday inet_ntoa memmove memset select socket strcasecmp strchr])

AC_CONFIG_FILES([Makefile
		man/Makefile
		src/libsocks/Makefile
		src/Makefile
		scripts/Makefile])

AC_OUTPUT
